package com.app.game.bet.dozen;

import java.util.HashSet;


public class BetColumn extends BetTwoToOne{
	public static enum Type{FIRST,SECOND,THIRD}

	private static final HashSet<Integer> first = new HashSet<Integer>();
	static{
		
		for(int i = 0 ; i < 12; ++i){
			first.add(1 + (i*3));
		}
	};
	
	private static final HashSet<Integer> second = new HashSet<Integer>();
	static{
		for(int i = 0 ; i < 12; ++i){
			second.add(2 + (i*3));
		}
	}
	
	private static final HashSet<Integer> third = new HashSet<Integer>();
	static{
		for(int i = 0 ; i < 12; ++i){
			third.add(3 + (i*3));
		}
	}
	private Type type;
	
	public BetColumn(Type type) {
		super();
		this.type = type;
	}
	
	@Override
	protected boolean isWin(int result) {
		if(type == Type.FIRST && first.contains(result)){
			return true;
		}
		if(type == Type.SECOND && second.contains(result)){
			return true;
		}
		if(type == Type.THIRD && third.contains(result)){
			return true;
		}
		
		return false;
	}
}
